package com.rain.jwt.common;

import lombok.Data;
import lombok.Getter;

/**
 * 业务异常
 * @author: wu
 * @date: 2021/9/25
 */
@Getter
public class BizException extends RuntimeException{

    private int code;

    private String msg;

    private ResultEnum resultEnum;

    public BizException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BizException(ResultEnum resultEnum) {
        this.resultEnum = resultEnum;
        this.code = resultEnum.getCode();
        this.msg = resultEnum.getMsg();
    }
}
